package action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class Login extends ActionSupport {
	private String username;
	private String password;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
//		return super.execute();
		if(getUsername().equals("whk") && getPassword().equals("whk")){
			ActionContext.getContext().getSession().put("user", getUsername());
			return SUCCESS;
		}else{
			return ERROR;
		}
	}

}
